!{include file='common/iheader.htm'}
<style>
	.acl_name{text-indent:20px;}
	.namespace{min-width:60px;}
	.acl_item{display:inline-block;padding:3px 5px;border-radius:3px;border:1px solid #F2F5F7;}
	.acl_item .del_a{visibility:hidden;}
	.acl_item .del_a .ui-icon{display:inline-block;vertical-align:middle;}
	.acl_item a{text-decoration:none;} 
	.acl_item:hover{border:1px solid #158144;background:#DEEDF7}
	.acl_item:hover .del_a{visibility:visible;}
	.list_table tr:hover td{background:none;}
</style>
<div id="i_nav">
	<h3 class="page_title">权限列表 </h3>
	<a class="button ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" href="/admin.php?app=acl&act=edit"><span class="ui-icon ui-icon-document"></span>添加权限</a>
</div>
<table class="list_table">
	!{foreach from=$acl_list item=namespace_info key=namespace}
	<tr>
		<th class="namespace"><b>!{$namespace_info.name}</b></th>
		<td>
			!{foreach from=$namespace_info.items item=acl key=a}
			<div class="acl_item">
				<a href="/admin.php?app=acl&act=edit&acl=!{$a}&ns=!{$namespace}">!{$acl.name}</a> [!{$a}]
				<a href="javascript:void(0);" onclick="del('!{$namespace}', !{$a})" class="del_a"><span class="ui-icon ui-icon-trash"></span>删除</a>
			</div>
			!{/foreach}
		</td>
	</tr>
	!{foreachelse}
	<tr colspan="3">
		<td>暂无数据</td>
	</tr>
	!{/foreach}
</table>
</div>
<script language="javascript">
	function del(namespace, acl){
		if(confirm('删除此权限将使用此权限失效，是否继续？')){
			$.get('/admin.php?app=acl&act=del&acl=' + acl + '&ns=' + namespace, function(data){
				var json = eval('(' + data + ')');
				alert(json.info);
				if(json.result){
					window.location.href = '/admin.php?app=acl';
				}
			});
		}
	}
</script>
!{include file='common/ifooter.htm'}